package cn.kgc.springcloud.controller;

import cn.kgc.springcloud.form.StudentForm;
import cn.kgc.springcloud.service.StudentService;
import cn.kgc.springcloud.vo.StudentVO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 课工场
 * @date 2025/1/17
 * @description
 */
@RestController
@RequestMapping("student")
public class StudentController {

    @Resource
    private StudentService studentService;

    @GetMapping
    public List<StudentVO> studentList(){
        return studentService.studentList();
    }

    @PostMapping
    public StudentVO addStudent(@RequestBody StudentForm studentForm){
        return studentService.addStudent(studentForm);
    }
}
